package com.wxlsoft.utils;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

public class Maps {

	public static Map<String, String> of(String key, String value) {
		HashMap<String, String> hashMap = new HashMap<>();
		hashMap.put(key, value);
		return hashMap;
	}
	
	public static Map<String, String> jsonHeaders() {
		HashMap<String, String> headers = new HashMap<>();
		headers.put("Accept", "application/json, text/plain, */*");
		headers.put("Content-Type", "application/json;charset=UTF-8");
		headers.put("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
		return headers;
	}
	
	public static Map<String, String> jsonHeaders(String token) {
		Map<String, String> headers = jsonHeaders();
		if (Objects.nonNull(token)) {
			headers.put("Blade-Auth", String.format("bearer %s", token));
		}
		return headers;
	}
	
	public static Map<String, String> multipartHeaders(String token) {
		Map<String, String> headers = jsonHeaders(token);
		return headers;
	}	
	
}
